import time

def read2list(file):
    file = open(file, 'r')
    l = file.readlines()
    return(l)

def mq_sort(a):
    for i in range(len(a)-1):
        if a[i] > a[i + 1]:
            a[i], a[i + 1] = a[i + 1], a[i]

m1 = read2list('m1_sorted.txt')
ts = time.time()
mq_sort(m1)
tf = time.time()
print('m1_sorted',(tf-ts)* 1000, 'millisec.')
m2 = read2list('m2_reverse.txt')
ts = time.time()
mq_sort(m2)
tf = time.time()
print('m2_sorted',(tf-ts)* 1000, 'millisec.')
m3 = read2list('m3_shuffle.txt')
ts = time.time()
mq_sort(m3)
tf = time.time()
print('m3_sorted',(tf-ts)* 1000, 'millisec.')
